package com.hxci.zhangcong.controller;

import com.hxci.zhangcong.pojo.Course;
import com.hxci.zhangcong.servcie.CorseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("course")
public class CourseController {
    @Autowired
    CorseService service;

    @RequestMapping("view")
    public String view(){
        return "zhangcong/index";
    }
    @ResponseBody
    @RequestMapping("query")
    public List<Course> query(){
        System.out.println("==========");
        List<Course>  list =  service.query();
        return list;
    }

}
